#ifndef _GlsxCommon_AtomicCounter_H_
#define _GlsxCommon_AtomicCounter_H_

#include "GlsxCommon.h"

BEGIN_GLSX_NAMESPACE

class GlsxCommon_API AtomicCounter
{
public:
	typedef LONG ValueType; 
	
	AtomicCounter();
		
	explicit AtomicCounter(ValueType initialValue);
	
	AtomicCounter(const AtomicCounter& counter);
	
	~AtomicCounter();

	AtomicCounter& operator = (const AtomicCounter& counter);
		
	AtomicCounter& operator = (ValueType value);

	operator ValueType () const;
		
	ValueType value() const;
		
	ValueType operator ++ ();
		
	ValueType operator ++ (int);
		
	ValueType operator -- (); 
		
	ValueType operator -- (int);
		
	bool operator ! () const;

private:
	ValueType _counter;
};


END_GLSX_NAMESPACE


#endif 
